from .GetChatRecord import GetChatRecordTool
from .GetOprationChainFromChat import GetOprationChainTool
from .GetUserEvaluation import GetUserEvaluationTool
from .GetQuestionEvalution import GetQuestionEvaluationTool

def get_tools():
    """返回所有可用的工具类"""
    return [
        GetChatRecordTool,
        GetOprationChainTool,
        GetUserEvaluationTool,
        GetQuestionEvaluationTool
    ]

def execute_tool(tool_name: str, **params):
    """执行指定的工具"""
    tool_map = {
        "GetChatRecordTool": GetChatRecordTool,
        "GetOprationChainTool": GetOprationChainTool,
        "GetUserEvaluationTool": GetUserEvaluationTool,
        "GetQuestionEvaluationTool": GetQuestionEvaluationTool
    }
    
    if tool_name not in tool_map:
        raise ValueError(f"Unknown tool: {tool_name}")
    
    tool_class = tool_map[tool_name]
    tool_instance = tool_class()
    
    # 创建输入schema实例
    input_schema = tool_class.input_schema(**params)
    
    # 执行工具
    result = tool_instance.run(input_schema)
    
    return result

__all__ = [
    "get_tools",
    "execute_tool",
    "GetChatRecordTool",
    "GetOprationChainTool",
    "GetUserEvaluationTool",
    "GetQuestionEvaluationTool"
]